package com.dnb.webmash.playmaker.client.playertypes;

import com.dnb.webmash.playmaker.client.ClientFieldVerifier;
import com.dnb.webmash.playmaker.client.mediaplayer.MediaPlayer;
import com.dnb.webmash.playmaker.shared.PlayerType;
import com.google.gwt.dom.client.Document;

//universal MIME TYPE EMBEDDER
public class FilePlayer extends MediaPlayer{			
	
	public FilePlayer() {
		myType = PlayerType.FILE;
		myElement = Document.get().createObjectElement();
		setElement(myElement);		
	}		
	@Override
	protected void embed() {
		if (ClientFieldVerifier.isValidURL(this.mediaIt.getFullURL())){			
			appendEmbedIFrameElement();
		}
	}	
	private void appendEmbedIFrameElement() {
		myElement.setAttribute("data", mediaIt.getFullURL());
		getElement().appendChild(myElement);
	}
}
